﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components {
    import flash.display.*;
    import net.wooga.pets.views.*;
    import net.wooga.pets.views.waitingQueue.*;
    import reprise.tweens.*;
    import net.wooga.pets.views.kindergarten.*;
    import net.wooga.pets.utils.*;
    import com.robertpenner.easing.*;

    public class HospitalView extends Sprite {

        private var _hospitalDisplay:Sprite;
        private var _doctorsDisplay:Sprite;
        private var _petsDisplay:Sprite;
        private var _waitingPetsDisplay:Sprite;
        private var _avatarDisplay:Sprite;
        private var _kindergartenTeaser:Sprite;
        private var _rewardsDisplay:RewardsDisplay;
        private var _placeholderView:PlaceHolderView;
        private var _coinAnimationDisplay:Sprite;
        private var _speechbubbleDisplay:SpeechBubbleDisplay;
        private var _babyCycleView:BabyCycleView;
        private var _queuedPetDiseaseInfo:QueuedPetBubble;

        public function HospitalView(){
            this._placeholderView = new PlaceHolderView();
            super();
            this.init();
            addChild(this._placeholderView);
        }
        public function init():void{
            visible = true;
            this._hospitalDisplay = new Sprite();
            this._doctorsDisplay = new Sprite();
            this._rewardsDisplay = new RewardsDisplay();
            this._petsDisplay = new Sprite();
            this._petsDisplay.mouseEnabled = false;
            this._petsDisplay.mouseChildren = true;
            this._waitingPetsDisplay = new Sprite();
            this._waitingPetsDisplay.mouseEnabled = false;
            this._waitingPetsDisplay.mouseChildren = true;
            this._avatarDisplay = new Sprite();
            this._avatarDisplay.mouseEnabled = false;
            this._avatarDisplay.mouseChildren = false;
            this._coinAnimationDisplay = new CoinAnimationView();
            this._speechbubbleDisplay = new SpeechBubbleDisplay();
            this._babyCycleView = new BabyCycleView();
            this._queuedPetDiseaseInfo = new QueuedPetBubble();
            addChild(this._hospitalDisplay);
            addChild(this._doctorsDisplay);
            addChild(this._petsDisplay);
            addChild(this._waitingPetsDisplay);
            addChild(this._avatarDisplay);
            addChild(this._coinAnimationDisplay);
            addChild(this._speechbubbleDisplay);
            addChild(this._babyCycleView);
            addChild(this._rewardsDisplay);
            addChild(this._queuedPetDiseaseInfo);
        }
        public function reset():void{
            Displays.removeAllChildren(this._petsDisplay);
            removeChild(this._petsDisplay);
            removeChild(this._waitingPetsDisplay);
            removeChild(this._doctorsDisplay);
            removeChild(this._hospitalDisplay);
            removeChild(this._avatarDisplay);
            removeChild(this._coinAnimationDisplay);
            removeChild(this._speechbubbleDisplay);
            removeChild(this._babyCycleView);
            removeChild(this._rewardsDisplay);
            removeChild(this._queuedPetDiseaseInfo);
            if (((this._kindergartenTeaser) && (contains(this._kindergartenTeaser)))){
                removeChild(this._kindergartenTeaser);
            };
            this._hospitalDisplay = (this._coinAnimationDisplay = (this._petsDisplay = (this._avatarDisplay = (this._kindergartenTeaser = (this._rewardsDisplay = null)))));
            this._babyCycleView = null;
            this._speechbubbleDisplay = null;
        }
        public function show():void{
            var _local1:SimpleTween = new SimpleTween(400, 500);
            _local1.addTweenProperty(this, "alpha", this.alpha, 1, Quad.easeInOut);
            _local1.execute();
        }
        public function hide():void{
            var _local1:SimpleTween = new SimpleTween(400);
            _local1.addTweenProperty(this, "alpha", this.alpha, 0, Quad.easeInOut);
            _local1.execute();
        }
        public function get hospitalDisplay():Sprite{
            return (this._hospitalDisplay);
        }
        public function get doctorsDisplay():Sprite{
            return (this._doctorsDisplay);
        }
        public function get petsDisplay():Sprite{
            return (this._petsDisplay);
        }
        public function get avatarDisplay():Sprite{
            return (this._avatarDisplay);
        }
        public function removeKindergartenTeaser():void{
            if (((this._kindergartenTeaser) && (contains(this._kindergartenTeaser)))){
                removeChild(this._kindergartenTeaser);
            };
        }
        public function addKindergartenTeaser():void{
            this._kindergartenTeaser = new KindergartenTeaserDisplay();
            var _local1:int = getChildIndex(this._petsDisplay);
            addChildAt(this._kindergartenTeaser, (_local1 + 1));
        }
        public function get waitingPetsDisplay():Sprite{
            return (this._waitingPetsDisplay);
        }
        public function set waitingPetsDisplay(_arg1:Sprite):void{
            this._waitingPetsDisplay = _arg1;
        }

    }
}//package net.wooga.pets.views.components 
